/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controllers;

import java.net.MalformedURLException;
import java.net.URL;
import loginwebservice.Branch;
import loginwebservice.Login;
import loginwebservice.Login_Service;

/**
 *
 * @author julianDavidPG
 */
public class LoginServiceControl {

    private final String serviceLocation = "http://localhost:8080/Login/Login?WSDL";
    private URL url = null;

    public LoginServiceControl() {
        try {
            url = new URL(serviceLocation);
        } catch (MalformedURLException malformedURLException) {
            System.out.println("direccion invalida");
        }

    }

    public static Branch login(java.lang.String user, java.lang.String password) {
        Login_Service service = new Login_Service();
        Login port = service.getLoginPort();
        return port.login(user, password);
    }

    public static java.util.List<loginwebservice.Branch> getBranchByStore(long store) {
        Login_Service service = new Login_Service();
        Login port = service.getLoginPort();
        return port.getBranchByStore(store);
    }

    public static void insertInMongo() {
        Login_Service service = new Login_Service();
        Login port = service.getLoginPort();
        port.insertInMongo();
    }
    
}
